﻿using Eqwww.Domain.Models.Identity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Eqwww.Domain.Models.SystemManage
{
    public class ModuleModel : ICreateAudited, ILastUpdateAudited, IDeleteAudited
    {
        public string Id { get; set; }
        [Display(Name = "创建人")]
        public string CreateUserId { get; set; }
        public virtual UserModel CreateUser { get; set; }
        [Display(Name = "创建时间")]
        public DateTime? CreateTime { get; set; }
        [Display(Name = "最后更新人")]
        public string LastUpdateUserId { get; set; }
        public virtual UserModel LastUpdateUser { get; set; }
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdateTime { get; set; }
        [Display(Name = "删除标识")]
        public bool? DeleteMark { get; set; }
        [Display(Name = "删除人")]
        public string DeleteUserId { get; set; }
        public virtual UserModel DeleteUser { get; set; }
        [Display(Name = "删除时间")]
        public DateTime? DeleteTime { get; set; }

        [Required(ErrorMessage = "本项不能为空")]
        [Display(Name = "编码")]
        public string Code { get; set; }

        [Required(ErrorMessage = "本项不能为空")]
        [Display(Name = "名称")]
        public string Name { get; set; }
        [Display(Name = "上级模块")]
        public string ParentId { get; set; }

        public virtual ModuleModel Parent { get; set; }

        [Display(Name = "菜单标识")]
        public bool? MenuMark { get; set; }
        [Display(Name = "链接地址")]
        public string Url { get; set; }

        [Required(ErrorMessage = "本项不能为空")]
        [Display(Name = "图标")]
        public string Icon { get; set; }

        [Required(ErrorMessage = "本项不能为空")]
        [Display(Name = "排序码")]
        public int? SortCode { get; set; }

        [Display(Name="层级")]
        public int? Layer { get; set; }

        [Required(ErrorMessage = "本项不能为空")]
        [Display(Name = "打开方式")]
        public ModuleOpenType? ModuleOpenType { get; set; }

        [Display(Name = "系统模块标识")]
        public bool? IsSystem { get; set; }
    }
}
